package edu.nf.takeoutdemo.model.converter;

import edu.nf.takeoutdemo.model.entity.OrderDetail;
import edu.nf.takeoutdemo.model.entity.ShoppingCart;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;

/**
 *
 * @author zjl
 * @date 2025/10/30
 */
@Mapper(componentModel = "spring")
public interface OrderDetailConverter {

    @Mappings({
            @Mapping(source = "name", target = "name"),
            @Mapping(source = "image", target = "image"),
            @Mapping(source = "dishId", target = "dishId"),
            @Mapping(source = "setmealId", target = "setmealId"),
            @Mapping(source = "dishFlavor", target = "dishFlavor"),
            @Mapping(source = "number", target = "number"),
            @Mapping(source = "amount", target = "amount")
    })
    OrderDetail toOrderDetail(ShoppingCart shoppingCart);
}
